
/*

public class Test {
    public static void main(String [] sags){
        for (int year = 2000; year <3000 ; year++) {
            if((year % 4 == 0 && year % 100 != 0)||( year % 400 == 0)){
                System.out.println(year);
            }
        }
    }
}
*/
/*

public class Test {
    public static void main(String [] sags){

           */
/* System.out.println(5/2);
            System.out.println((float)5/2);
            System.out.println(5/(float)2);
            System.out.println((float)(5/2));*//*


        */
/*System.out.println(10%3);
        System.out.println(-10%3);
        System.out.println(10%-3);
        System.out.println(-10%-3);*//*


        //System.out.println(1+0.2);
        // +的左侧是int，右侧是double，在加之前int被提升为double故：输出1.2

*/
/*

public class Test{
    public static void main(String[] args){
        int a=112;
        if(a%2==0){
            System.out.println("偶数");
        }else{
            System.out.println("奇数");
        }
    }
}*/

//1. 根据年龄, 来打印出当前年龄的人是少年(低于18), 青年(19-28), 中年(29-55), 老年(56以上)
/*
public class Test{
    public static void main(String [] args){
        int age=60;
        if(age<=18){
            System.out.println("少年");
        }else if(age<=28) {
            System.out.println("青年");
        }else if(age<=55) {
            System.out.println("中年");
        }else {
            System.out.println("老年");
        }
    }
}*/

//2. 判定一个数字是否是素数
/*
public class Test{
    public static void main(String[] args){
        int a=4;
        int flag=0;
        for (int i = 2; i < a ; i++) {
            if(a % i == 0){
                System.out.println("不是素数");
                flag=1;
                break;
            }
        }
        if(flag==0){
            System.out.println("是素数");
        }
    }
}
*/

//3. 打印 1 - 100 之间所有的素数
/*
public class Test{
    public static void main(String[] args){
        for (int i = 1; i <= 100; i++) {
            int flag=0;
            for (int j = 2; j < i; j++) {
                if(i % j == 0){
                    flag = 1;
                }
            }
            if(flag==0){
                System.out.println(i);
            }
        }
    }
}*/

//4. 输出 1000 - 2000 之间所有的闰年
/*
public class Test{
    public static void main(String[] args){
        for (int i = 1; i <= 9; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j+" * "+i+" = "+(j*i)+"   ");
            }
            System.out.println("");
        }
    }
}*/

//6. 求两个正整数的最大公约数
/*

public class Test{
    public static void main(String [] args){
        int a=9;
        int b=36;
        int t=a*b;
        int r=a%b;
        while(r!=0){
            a=b;
            b=r;
            r=a%b;
        }
        System.out.println("最大公约数:"+b);
        System.out.println("最小公倍数:"+(t/b));
    }
}
*/

//7. 求出0～999之间的所有“水仙花数”并输出。
/*public class Test{
    public static void main(String[] args){
        for (int i = 100; i < 1000; i++) {
            int t=i;
            int sum=0;
            while(t!=0){
                sum+=(t%10)*(t%10)*(t%10);
                t/=10;
            }
            if(sum==i){
                System.out.println(i);
            }
        }
    }
}*/

//8. 写一个函数返回参数二进制中 1 的个数
/*public class Test{
    public static void main(String[] args){
        int a=2147483647;
        int cnt=0;
        for (int i = 0; i < 32; i++) {
            if((a>>i&1)==1){
                cnt++;
            }
        }
        System.out.println(cnt);
        System.out.println(Integer.MAX_VALUE);
    }
}*/

//9. 获取一个数二进制序列中所有的偶数位和奇数位，分别输出二进制序列。
/*
public class Test{
    public static void main(String[] args){
        int a=405;
        System.out.println("偶数位：");
        for (int i = 31; i >=0; i-=2) {
            System.out.print((a>>i)&1);
        }
        System.out.println("\n奇数位：");
        for (int i = 30; i >=0; i-=2) {
            System.out.print((a>>i)&1);
        }
    }
}

*/


//判断闰年
/*

import java.util.Scanner;

public class Test{
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int year = scanner.nextInt();

        if(year%100==0) {
            if(year%400==0) {
                System.out.println("世纪闰年");
            }else {
                System.out.println("不是闰年");
            }
        }else {
            if(year%4==0) {
                System.out.println("普通闰年");
            }else {
                System.out.println("不是闰年");
            }
        }
    }
}
*/
/*
//输入
import java.util.Scanner;

public class Test{
    public static void main(String[] args){
        System.out.println("请输入：");
        Scanner scanner = new Scanner(System.in);
        int a=scanner.nextInt();
        System.out.println(a);
        Scanner b = new Scanner(System.in);
        int c=b.nextInt();
        System.out.println(c);
    }

}*/
/*

import java.util.Scanner;

public class Test{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int i=1;
        int ret=1;
        int sum=0;
        while(i<=n){
            ret*=i;
            sum+=ret;
            i++;
        }
        System.out.println(sum);
    }
}
*/

/*public class Test{
    public static void main(String[] args){
        for (int i = 1; i <= 100 ; i++) {
            if(i % 3 !=0 || i % 5!=0){
                continue;
            }
            System.out.println(i);
        }
    }
}*/

/*
import java.util.Scanner;

public class Test{
    public static void main(String[] args){

        int a=10;
        System.out.printf("%s\n","hello world");
        System.out.printf("%d\n",89);

        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入你的年龄:");
        int age = scanner.nextInt();
        System.out.println(age);

        scanner.nextLine();//读取换行符

        System.out.println("请输入你的姓名：");
        String name = scanner.nextLine();
        System.out.println(name);

        System.out.println("请输入你的工资：");
        float f = scanner.nextFloat();
        System.out.println(f);
    }
}*/

/*
import java.util.Scanner;
public class Test{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        *//*while(scanner.hasNextInt()){
            int a=scanner.nextInt();
            System.out.println(a);
        }*//*
        while(scanner.hasNextLine()){
            String s = scanner.nextLine();
            System.out.println(s);
        }
    }
}*/
/*
//猜数字游戏
import java.util.Random;
import java.util.Scanner;
public class Test{
    public static void main(String[] args){
        Random random = new Random();  //根据当前的时间生成随机数
        int randNum = random.nextInt(100);//[0~100]
        Scanner scanner = new Scanner(System.in);
        while(true){
            System.out.println("请输入你猜的数字:");
            int num=scanner.nextInt();
            if(num>randNum){
                System.out.println("猜大了！");
            }else if(num == randNum) {
                System.out.println("猜对了!");
                break;
            }else {
                System.out.println("猜小了!");
            }
        }
    }
}*/

/*
public class Test{
    public static void main(String [] args){
        int cnt=0;
        for (int i = 1; i <=99 ; i++) {
            int t = i;
            while(t != 0) {
                if(t % 10 == 9) {
                    cnt++;
                }
                t /=10;
            }
        }
        System.out.println(cnt);
    }
}*/

//import java.util.Scanner;
/*public class Test{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int flag = 0;
        for (int i = 2; i < n; i++) {
            if(n % i == 0){
                System.out.println("不是素数");
                flag = 1;
                break;
            }
        }
        if(flag == 0) {
            System.out.println("是素数");
        }
    }
}*/
/*

import java.util.Scanner;
public class Test{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int r = a % b;
        while(r != 0){
            a = b;
            b = r;
            r = a % b;
        }
        System.out.println(b);
    }
}
*/
/*

public class Test{
    public static void main(String[] args){
        int n = 100;
        double sum = 0;
        int flag = 1;
        for (int i = 1; i <= n; i++) {
            sum += (1.0 / i) * flag;
            flag = -flag;
        }
        System.out.println(sum);
    }
}
*/
/*

import java.util.Scanner;
public class Test{
    public static void main(String [] args){
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        for (int i = 1; i <= x; i++) {
            for (int j= 1; j <= x ; j++) {
                if(i == j || i == x - j + 1){
                    System.out.print("*");
                }else{
                    System.out.print(" ");
                }
            }
            System.out.println("");
        }
    }
}
*/
/*
import java.util.Scanner;
public class Test{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(i+"*"+j+"="+(i*j)+" ");
            }
            System.out.println("");
        }
    }
}*/
/*
import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str1 = "abc123";
        System.out.println("请输入密码：");
        int count = 0;
        while(true){
            String str2 = scanner.nextLine();
            if(str1.compareTo(str2) == 0){
                System.out.println("登录成功！");
                break;
            }else {
                if(count < 2) {
                    System.out.println("密码错误，请重新输入!");
                }
                count++;
            }
            if(count == 3) {
                System.out.println("你已经输入错误密码3次,程序退出！");
                break;
            }
        }
    }
}*/
/*
public class Test {
    public static void main(String[] args) {

      boolean flg = (true == true) ? (false ? true : false) : true;

    }
}*/
/*
import java.util.Scanner;
public class Test{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()) {
            int a = scanner.nextInt();
            System.out.println(a);
        }
    }
}*/

/*//方法
public class Test {
    public static int add(int a,int b){
        return a+b;
    }
    public static void main(String[] args) {
        int a=add(2,4);
        System.out.println(a);
    }
}*/

public class Test{
    public static int facSum(int n){
        int sum=0;
        for (int i = 1; i <= n; i++) {
            sum+=fac(i);
        }
        return sum;
    }
    public static int fac(int n){
        int ret=1;
        for (int i = 1; i <=n ; i++) {
            ret*=i;
        }
        return ret;
    }
    public static void main(String [] args){
        int ret=facSum(3);
        System.out.println(ret);
    }
}










